package top.fullj.chase;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import top.fullj.chase.annotation.DebugLog;
import top.fullj.chase.internal.Chase;

public class MainActivity extends AppCompatActivity {

    @DebugLog
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //Chase.setEnabled(false);
        hello();
    }

    @DebugLog
    private void hello() {
        System.out.println("hello");
        ToStringHelper helper = new ToStringHelper();
        helper.call();
        try {
            helper.error(999);
        } catch (RuntimeException ignore) {

        }
    }

    @DebugLog
    static class ToStringHelper {

        ToStringHelper() {
        }

        int call() {
            return 1;
        }

        int error(int val) {
            throw new RuntimeException("fault");
        }

    }

}